<?php

namespace app\common\controller;

use EasyWeChat\Factory;
use think\Controller;

/**
 * 基础控制器
 */

class App extends Controller
{


    private function setUserInfo($userInfo)
    {
        $this->userInfo = $userInfo;
    }


    protected function ok($msg = '成功', $data = [],$status=1)
    {
        return json([
            'status' => $status?$status:1,
            'msg'    => $msg,
            'data'   => $data,
        ]);
    }

    public function getAppLoginInfo()
    {
        return model("Member")->getAppLoginInfo();
    }

    /**
     * 一个失败返回的控制器封装
     * @param  array|string|int $data 返回的data数据
     * @param  array $data 返回的data数据
     * @return
     */
    protected function fail($msg = '失败', $data = [],$status=0)
    {
        return json([
            'status' => $status?$status:0,
            'msg'    => $msg,
            'data'   => $data,
        ]);
    }


    public function getLoginUid()
    {
        return model("Member")->getAppUid();


    }






}
